﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


using DatabaseCompare.Model;
using DatabaseCompare.Service.Compare;

namespace DatabaseCompare.ServiceImpl.Compare
{


    public abstract class CompareAbleCompare<T1>
        where T1 : CompareAble
    {

        /// <summary>
        /// 两个比较.
        /// </summary>
        /// <param name="left"></param>
        /// <param name="right"></param>
        /// <returns></returns>
        public CommonCompareResult CommonCompare(T1 left, T1 right)
        {
            if (left == null && right == null)
            {
                // 两个需要比较的，都是空.
                // 属于非法的输入.
                return CommonCompareResult.BothIsMissing;
            }
            else if (left == null && right != null)
            {
                // 左边的，是空.
                return CommonCompareResult.LeftIsMissing;
            }
            else if (left != null && right == null)
            {
                // 右边的，是空.
                return CommonCompareResult.RightIsMissing;
            }
            else
            {
                // 左右都不为空
                // 需要详细比较.
                // 首先默认是一样的
                return CommonCompareResult.FullSame;
            }
        }



    }


}
